package tools.jackson.module.kotlin.kogeraIntegration.deser.valueClass.parameterSize.nullablePrimitive

import com.fasterxml.jackson.annotation.JsonCreator
import tools.jackson.module.kotlin.assertReflectEquals
import tools.jackson.module.kotlin.callPrimaryConstructor
import tools.jackson.module.kotlin.defaultMapper
import tools.jackson.module.kotlin.kogeraIntegration.deser.valueClass.NullablePrimitive
import tools.jackson.module.kotlin.readValue
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test

// Convert the property p to q (but not the value) to make it an input to the factory function.
private fun replacePQ(src: String) = src.replace(Regex("""p\d+":""")) { "q" + it.value.substring(1) }

/**
 * Up to argument size 32 there is one mask argument for the default argument,
 * 33 ~ 64 there are two, and 65 there are three, so each boundary value is tested.
 * Also, the maximum size of arguments that can be set by a constructor
 * that includes a value class as an argument is 253 (one less by DefaultConstructorMarker), so test that case as well.
 */
class DeserializeByFactoryWithoutDefaultArgumentsTest {
    data class Dst32(
        val p00: NullablePrimitive,
        val p01: NullablePrimitive,
        val p02: NullablePrimitive,
        val p03: NullablePrimitive,
        val p04: NullablePrimitive,
        val p05: NullablePrimitive,
        val p06: NullablePrimitive,
        val p07: NullablePrimitive,
        val p08: NullablePrimitive,
        val p09: NullablePrimitive,
        val p10: NullablePrimitive,
        val p11: NullablePrimitive,
        val p12: NullablePrimitive,
        val p13: NullablePrimitive,
        val p14: NullablePrimitive,
        val p15: NullablePrimitive,
        val p16: NullablePrimitive,
        val p17: NullablePrimitive,
        val p18: NullablePrimitive,
        val p19: NullablePrimitive,
        val p20: NullablePrimitive,
        val p21: NullablePrimitive,
        val p22: NullablePrimitive,
        val p23: NullablePrimitive,
        val p24: NullablePrimitive,
        val p25: NullablePrimitive,
        val p26: NullablePrimitive,
        val p27: NullablePrimitive,
        val p28: NullablePrimitive,
        val p29: NullablePrimitive,
        val p30: NullablePrimitive,
        val p31: NullablePrimitive
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q00: NullablePrimitive,
                q01: NullablePrimitive,
                q02: NullablePrimitive,
                q03: NullablePrimitive,
                q04: NullablePrimitive,
                q05: NullablePrimitive,
                q06: NullablePrimitive,
                q07: NullablePrimitive,
                q08: NullablePrimitive,
                q09: NullablePrimitive,
                q10: NullablePrimitive,
                q11: NullablePrimitive,
                q12: NullablePrimitive,
                q13: NullablePrimitive,
                q14: NullablePrimitive,
                q15: NullablePrimitive,
                q16: NullablePrimitive,
                q17: NullablePrimitive,
                q18: NullablePrimitive,
                q19: NullablePrimitive,
                q20: NullablePrimitive,
                q21: NullablePrimitive,
                q22: NullablePrimitive,
                q23: NullablePrimitive,
                q24: NullablePrimitive,
                q25: NullablePrimitive,
                q26: NullablePrimitive,
                q27: NullablePrimitive,
                q28: NullablePrimitive,
                q29: NullablePrimitive,
                q30: NullablePrimitive,
                q31: NullablePrimitive
            ) = Dst32(
                q00,
                q01,
                q02,
                q03,
                q04,
                q05,
                q06,
                q07,
                q08,
                q09,
                q10,
                q11,
                q12,
                q13,
                q14,
                q15,
                q16,
                q17,
                q18,
                q19,
                q20,
                q21,
                q22,
                q23,
                q24,
                q25,
                q26,
                q27,
                q28,
                q29,
                q30,
                q31
            )
        }
    }

    @Test
    fun test32() {
        val expected = callPrimaryConstructor<Dst32> { NullablePrimitive(it.index) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        Assertions.assertEquals(expected, defaultMapper.readValue<Dst32>(src))
    }

    data class Dst33(
        val p00: NullablePrimitive,
        val p01: NullablePrimitive,
        val p02: NullablePrimitive,
        val p03: NullablePrimitive,
        val p04: NullablePrimitive,
        val p05: NullablePrimitive,
        val p06: NullablePrimitive,
        val p07: NullablePrimitive,
        val p08: NullablePrimitive,
        val p09: NullablePrimitive,
        val p10: NullablePrimitive,
        val p11: NullablePrimitive,
        val p12: NullablePrimitive,
        val p13: NullablePrimitive,
        val p14: NullablePrimitive,
        val p15: NullablePrimitive,
        val p16: NullablePrimitive,
        val p17: NullablePrimitive,
        val p18: NullablePrimitive,
        val p19: NullablePrimitive,
        val p20: NullablePrimitive,
        val p21: NullablePrimitive,
        val p22: NullablePrimitive,
        val p23: NullablePrimitive,
        val p24: NullablePrimitive,
        val p25: NullablePrimitive,
        val p26: NullablePrimitive,
        val p27: NullablePrimitive,
        val p28: NullablePrimitive,
        val p29: NullablePrimitive,
        val p30: NullablePrimitive,
        val p31: NullablePrimitive,
        val p32: NullablePrimitive
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q00: NullablePrimitive,
                q01: NullablePrimitive,
                q02: NullablePrimitive,
                q03: NullablePrimitive,
                q04: NullablePrimitive,
                q05: NullablePrimitive,
                q06: NullablePrimitive,
                q07: NullablePrimitive,
                q08: NullablePrimitive,
                q09: NullablePrimitive,
                q10: NullablePrimitive,
                q11: NullablePrimitive,
                q12: NullablePrimitive,
                q13: NullablePrimitive,
                q14: NullablePrimitive,
                q15: NullablePrimitive,
                q16: NullablePrimitive,
                q17: NullablePrimitive,
                q18: NullablePrimitive,
                q19: NullablePrimitive,
                q20: NullablePrimitive,
                q21: NullablePrimitive,
                q22: NullablePrimitive,
                q23: NullablePrimitive,
                q24: NullablePrimitive,
                q25: NullablePrimitive,
                q26: NullablePrimitive,
                q27: NullablePrimitive,
                q28: NullablePrimitive,
                q29: NullablePrimitive,
                q30: NullablePrimitive,
                q31: NullablePrimitive,
                q32: NullablePrimitive
            ) = Dst33(
                q00,
                q01,
                q02,
                q03,
                q04,
                q05,
                q06,
                q07,
                q08,
                q09,
                q10,
                q11,
                q12,
                q13,
                q14,
                q15,
                q16,
                q17,
                q18,
                q19,
                q20,
                q21,
                q22,
                q23,
                q24,
                q25,
                q26,
                q27,
                q28,
                q29,
                q30,
                q31,
                q32
            )
        }
    }

    @Test
    fun test33() {
        val expected = callPrimaryConstructor<Dst33> { NullablePrimitive(it.index) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        Assertions.assertEquals(expected, defaultMapper.readValue<Dst33>(src))
    }

    data class Dst64(
        val p00: NullablePrimitive,
        val p01: NullablePrimitive,
        val p02: NullablePrimitive,
        val p03: NullablePrimitive,
        val p04: NullablePrimitive,
        val p05: NullablePrimitive,
        val p06: NullablePrimitive,
        val p07: NullablePrimitive,
        val p08: NullablePrimitive,
        val p09: NullablePrimitive,
        val p10: NullablePrimitive,
        val p11: NullablePrimitive,
        val p12: NullablePrimitive,
        val p13: NullablePrimitive,
        val p14: NullablePrimitive,
        val p15: NullablePrimitive,
        val p16: NullablePrimitive,
        val p17: NullablePrimitive,
        val p18: NullablePrimitive,
        val p19: NullablePrimitive,
        val p20: NullablePrimitive,
        val p21: NullablePrimitive,
        val p22: NullablePrimitive,
        val p23: NullablePrimitive,
        val p24: NullablePrimitive,
        val p25: NullablePrimitive,
        val p26: NullablePrimitive,
        val p27: NullablePrimitive,
        val p28: NullablePrimitive,
        val p29: NullablePrimitive,
        val p30: NullablePrimitive,
        val p31: NullablePrimitive,
        val p32: NullablePrimitive,
        val p33: NullablePrimitive,
        val p34: NullablePrimitive,
        val p35: NullablePrimitive,
        val p36: NullablePrimitive,
        val p37: NullablePrimitive,
        val p38: NullablePrimitive,
        val p39: NullablePrimitive,
        val p40: NullablePrimitive,
        val p41: NullablePrimitive,
        val p42: NullablePrimitive,
        val p43: NullablePrimitive,
        val p44: NullablePrimitive,
        val p45: NullablePrimitive,
        val p46: NullablePrimitive,
        val p47: NullablePrimitive,
        val p48: NullablePrimitive,
        val p49: NullablePrimitive,
        val p50: NullablePrimitive,
        val p51: NullablePrimitive,
        val p52: NullablePrimitive,
        val p53: NullablePrimitive,
        val p54: NullablePrimitive,
        val p55: NullablePrimitive,
        val p56: NullablePrimitive,
        val p57: NullablePrimitive,
        val p58: NullablePrimitive,
        val p59: NullablePrimitive,
        val p60: NullablePrimitive,
        val p61: NullablePrimitive,
        val p62: NullablePrimitive,
        val p63: NullablePrimitive
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q00: NullablePrimitive,
                q01: NullablePrimitive,
                q02: NullablePrimitive,
                q03: NullablePrimitive,
                q04: NullablePrimitive,
                q05: NullablePrimitive,
                q06: NullablePrimitive,
                q07: NullablePrimitive,
                q08: NullablePrimitive,
                q09: NullablePrimitive,
                q10: NullablePrimitive,
                q11: NullablePrimitive,
                q12: NullablePrimitive,
                q13: NullablePrimitive,
                q14: NullablePrimitive,
                q15: NullablePrimitive,
                q16: NullablePrimitive,
                q17: NullablePrimitive,
                q18: NullablePrimitive,
                q19: NullablePrimitive,
                q20: NullablePrimitive,
                q21: NullablePrimitive,
                q22: NullablePrimitive,
                q23: NullablePrimitive,
                q24: NullablePrimitive,
                q25: NullablePrimitive,
                q26: NullablePrimitive,
                q27: NullablePrimitive,
                q28: NullablePrimitive,
                q29: NullablePrimitive,
                q30: NullablePrimitive,
                q31: NullablePrimitive,
                q32: NullablePrimitive,
                q33: NullablePrimitive,
                q34: NullablePrimitive,
                q35: NullablePrimitive,
                q36: NullablePrimitive,
                q37: NullablePrimitive,
                q38: NullablePrimitive,
                q39: NullablePrimitive,
                q40: NullablePrimitive,
                q41: NullablePrimitive,
                q42: NullablePrimitive,
                q43: NullablePrimitive,
                q44: NullablePrimitive,
                q45: NullablePrimitive,
                q46: NullablePrimitive,
                q47: NullablePrimitive,
                q48: NullablePrimitive,
                q49: NullablePrimitive,
                q50: NullablePrimitive,
                q51: NullablePrimitive,
                q52: NullablePrimitive,
                q53: NullablePrimitive,
                q54: NullablePrimitive,
                q55: NullablePrimitive,
                q56: NullablePrimitive,
                q57: NullablePrimitive,
                q58: NullablePrimitive,
                q59: NullablePrimitive,
                q60: NullablePrimitive,
                q61: NullablePrimitive,
                q62: NullablePrimitive,
                q63: NullablePrimitive
            ) = Dst64(
                q00,
                q01,
                q02,
                q03,
                q04,
                q05,
                q06,
                q07,
                q08,
                q09,
                q10,
                q11,
                q12,
                q13,
                q14,
                q15,
                q16,
                q17,
                q18,
                q19,
                q20,
                q21,
                q22,
                q23,
                q24,
                q25,
                q26,
                q27,
                q28,
                q29,
                q30,
                q31,
                q32,
                q33,
                q34,
                q35,
                q36,
                q37,
                q38,
                q39,
                q40,
                q41,
                q42,
                q43,
                q44,
                q45,
                q46,
                q47,
                q48,
                q49,
                q50,
                q51,
                q52,
                q53,
                q54,
                q55,
                q56,
                q57,
                q58,
                q59,
                q60,
                q61,
                q62,
                q63
            )
        }
    }

    @Test
    fun test64() {
        val expected = callPrimaryConstructor<Dst64> { NullablePrimitive(it.index) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        Assertions.assertEquals(expected, defaultMapper.readValue<Dst64>(src))
    }

    data class Dst65(
        val p00: NullablePrimitive,
        val p01: NullablePrimitive,
        val p02: NullablePrimitive,
        val p03: NullablePrimitive,
        val p04: NullablePrimitive,
        val p05: NullablePrimitive,
        val p06: NullablePrimitive,
        val p07: NullablePrimitive,
        val p08: NullablePrimitive,
        val p09: NullablePrimitive,
        val p10: NullablePrimitive,
        val p11: NullablePrimitive,
        val p12: NullablePrimitive,
        val p13: NullablePrimitive,
        val p14: NullablePrimitive,
        val p15: NullablePrimitive,
        val p16: NullablePrimitive,
        val p17: NullablePrimitive,
        val p18: NullablePrimitive,
        val p19: NullablePrimitive,
        val p20: NullablePrimitive,
        val p21: NullablePrimitive,
        val p22: NullablePrimitive,
        val p23: NullablePrimitive,
        val p24: NullablePrimitive,
        val p25: NullablePrimitive,
        val p26: NullablePrimitive,
        val p27: NullablePrimitive,
        val p28: NullablePrimitive,
        val p29: NullablePrimitive,
        val p30: NullablePrimitive,
        val p31: NullablePrimitive,
        val p32: NullablePrimitive,
        val p33: NullablePrimitive,
        val p34: NullablePrimitive,
        val p35: NullablePrimitive,
        val p36: NullablePrimitive,
        val p37: NullablePrimitive,
        val p38: NullablePrimitive,
        val p39: NullablePrimitive,
        val p40: NullablePrimitive,
        val p41: NullablePrimitive,
        val p42: NullablePrimitive,
        val p43: NullablePrimitive,
        val p44: NullablePrimitive,
        val p45: NullablePrimitive,
        val p46: NullablePrimitive,
        val p47: NullablePrimitive,
        val p48: NullablePrimitive,
        val p49: NullablePrimitive,
        val p50: NullablePrimitive,
        val p51: NullablePrimitive,
        val p52: NullablePrimitive,
        val p53: NullablePrimitive,
        val p54: NullablePrimitive,
        val p55: NullablePrimitive,
        val p56: NullablePrimitive,
        val p57: NullablePrimitive,
        val p58: NullablePrimitive,
        val p59: NullablePrimitive,
        val p60: NullablePrimitive,
        val p61: NullablePrimitive,
        val p62: NullablePrimitive,
        val p63: NullablePrimitive,
        val p64: NullablePrimitive
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q00: NullablePrimitive,
                q01: NullablePrimitive,
                q02: NullablePrimitive,
                q03: NullablePrimitive,
                q04: NullablePrimitive,
                q05: NullablePrimitive,
                q06: NullablePrimitive,
                q07: NullablePrimitive,
                q08: NullablePrimitive,
                q09: NullablePrimitive,
                q10: NullablePrimitive,
                q11: NullablePrimitive,
                q12: NullablePrimitive,
                q13: NullablePrimitive,
                q14: NullablePrimitive,
                q15: NullablePrimitive,
                q16: NullablePrimitive,
                q17: NullablePrimitive,
                q18: NullablePrimitive,
                q19: NullablePrimitive,
                q20: NullablePrimitive,
                q21: NullablePrimitive,
                q22: NullablePrimitive,
                q23: NullablePrimitive,
                q24: NullablePrimitive,
                q25: NullablePrimitive,
                q26: NullablePrimitive,
                q27: NullablePrimitive,
                q28: NullablePrimitive,
                q29: NullablePrimitive,
                q30: NullablePrimitive,
                q31: NullablePrimitive,
                q32: NullablePrimitive,
                q33: NullablePrimitive,
                q34: NullablePrimitive,
                q35: NullablePrimitive,
                q36: NullablePrimitive,
                q37: NullablePrimitive,
                q38: NullablePrimitive,
                q39: NullablePrimitive,
                q40: NullablePrimitive,
                q41: NullablePrimitive,
                q42: NullablePrimitive,
                q43: NullablePrimitive,
                q44: NullablePrimitive,
                q45: NullablePrimitive,
                q46: NullablePrimitive,
                q47: NullablePrimitive,
                q48: NullablePrimitive,
                q49: NullablePrimitive,
                q50: NullablePrimitive,
                q51: NullablePrimitive,
                q52: NullablePrimitive,
                q53: NullablePrimitive,
                q54: NullablePrimitive,
                q55: NullablePrimitive,
                q56: NullablePrimitive,
                q57: NullablePrimitive,
                q58: NullablePrimitive,
                q59: NullablePrimitive,
                q60: NullablePrimitive,
                q61: NullablePrimitive,
                q62: NullablePrimitive,
                q63: NullablePrimitive,
                q64: NullablePrimitive
            ) = Dst65(
                q00,
                q01,
                q02,
                q03,
                q04,
                q05,
                q06,
                q07,
                q08,
                q09,
                q10,
                q11,
                q12,
                q13,
                q14,
                q15,
                q16,
                q17,
                q18,
                q19,
                q20,
                q21,
                q22,
                q23,
                q24,
                q25,
                q26,
                q27,
                q28,
                q29,
                q30,
                q31,
                q32,
                q33,
                q34,
                q35,
                q36,
                q37,
                q38,
                q39,
                q40,
                q41,
                q42,
                q43,
                q44,
                q45,
                q46,
                q47,
                q48,
                q49,
                q50,
                q51,
                q52,
                q53,
                q54,
                q55,
                q56,
                q57,
                q58,
                q59,
                q60,
                q61,
                q62,
                q63,
                q64
            )
        }
    }

    @Test
    fun test65() {
        val expected = callPrimaryConstructor<Dst65> { NullablePrimitive(it.index) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        Assertions.assertEquals(expected, defaultMapper.readValue<Dst65>(src))
    }

    // It cannot be a data class because the generated method would exceed the argument size limit.
    class DstMax(
        val p000: NullablePrimitive,
        val p001: NullablePrimitive,
        val p002: NullablePrimitive,
        val p003: NullablePrimitive,
        val p004: NullablePrimitive,
        val p005: NullablePrimitive,
        val p006: NullablePrimitive,
        val p007: NullablePrimitive,
        val p008: NullablePrimitive,
        val p009: NullablePrimitive,
        val p010: NullablePrimitive,
        val p011: NullablePrimitive,
        val p012: NullablePrimitive,
        val p013: NullablePrimitive,
        val p014: NullablePrimitive,
        val p015: NullablePrimitive,
        val p016: NullablePrimitive,
        val p017: NullablePrimitive,
        val p018: NullablePrimitive,
        val p019: NullablePrimitive,
        val p020: NullablePrimitive,
        val p021: NullablePrimitive,
        val p022: NullablePrimitive,
        val p023: NullablePrimitive,
        val p024: NullablePrimitive,
        val p025: NullablePrimitive,
        val p026: NullablePrimitive,
        val p027: NullablePrimitive,
        val p028: NullablePrimitive,
        val p029: NullablePrimitive,
        val p030: NullablePrimitive,
        val p031: NullablePrimitive,
        val p032: NullablePrimitive,
        val p033: NullablePrimitive,
        val p034: NullablePrimitive,
        val p035: NullablePrimitive,
        val p036: NullablePrimitive,
        val p037: NullablePrimitive,
        val p038: NullablePrimitive,
        val p039: NullablePrimitive,
        val p040: NullablePrimitive,
        val p041: NullablePrimitive,
        val p042: NullablePrimitive,
        val p043: NullablePrimitive,
        val p044: NullablePrimitive,
        val p045: NullablePrimitive,
        val p046: NullablePrimitive,
        val p047: NullablePrimitive,
        val p048: NullablePrimitive,
        val p049: NullablePrimitive,
        val p050: NullablePrimitive,
        val p051: NullablePrimitive,
        val p052: NullablePrimitive,
        val p053: NullablePrimitive,
        val p054: NullablePrimitive,
        val p055: NullablePrimitive,
        val p056: NullablePrimitive,
        val p057: NullablePrimitive,
        val p058: NullablePrimitive,
        val p059: NullablePrimitive,
        val p060: NullablePrimitive,
        val p061: NullablePrimitive,
        val p062: NullablePrimitive,
        val p063: NullablePrimitive,
        val p064: NullablePrimitive,
        val p065: NullablePrimitive,
        val p066: NullablePrimitive,
        val p067: NullablePrimitive,
        val p068: NullablePrimitive,
        val p069: NullablePrimitive,
        val p070: NullablePrimitive,
        val p071: NullablePrimitive,
        val p072: NullablePrimitive,
        val p073: NullablePrimitive,
        val p074: NullablePrimitive,
        val p075: NullablePrimitive,
        val p076: NullablePrimitive,
        val p077: NullablePrimitive,
        val p078: NullablePrimitive,
        val p079: NullablePrimitive,
        val p080: NullablePrimitive,
        val p081: NullablePrimitive,
        val p082: NullablePrimitive,
        val p083: NullablePrimitive,
        val p084: NullablePrimitive,
        val p085: NullablePrimitive,
        val p086: NullablePrimitive,
        val p087: NullablePrimitive,
        val p088: NullablePrimitive,
        val p089: NullablePrimitive,
        val p090: NullablePrimitive,
        val p091: NullablePrimitive,
        val p092: NullablePrimitive,
        val p093: NullablePrimitive,
        val p094: NullablePrimitive,
        val p095: NullablePrimitive,
        val p096: NullablePrimitive,
        val p097: NullablePrimitive,
        val p098: NullablePrimitive,
        val p099: NullablePrimitive,
        val p100: NullablePrimitive,
        val p101: NullablePrimitive,
        val p102: NullablePrimitive,
        val p103: NullablePrimitive,
        val p104: NullablePrimitive,
        val p105: NullablePrimitive,
        val p106: NullablePrimitive,
        val p107: NullablePrimitive,
        val p108: NullablePrimitive,
        val p109: NullablePrimitive,
        val p110: NullablePrimitive,
        val p111: NullablePrimitive,
        val p112: NullablePrimitive,
        val p113: NullablePrimitive,
        val p114: NullablePrimitive,
        val p115: NullablePrimitive,
        val p116: NullablePrimitive,
        val p117: NullablePrimitive,
        val p118: NullablePrimitive,
        val p119: NullablePrimitive,
        val p120: NullablePrimitive,
        val p121: NullablePrimitive,
        val p122: NullablePrimitive,
        val p123: NullablePrimitive,
        val p124: NullablePrimitive,
        val p125: NullablePrimitive,
        val p126: NullablePrimitive,
        val p127: NullablePrimitive,
        val p128: NullablePrimitive,
        val p129: NullablePrimitive,
        val p130: NullablePrimitive,
        val p131: NullablePrimitive,
        val p132: NullablePrimitive,
        val p133: NullablePrimitive,
        val p134: NullablePrimitive,
        val p135: NullablePrimitive,
        val p136: NullablePrimitive,
        val p137: NullablePrimitive,
        val p138: NullablePrimitive,
        val p139: NullablePrimitive,
        val p140: NullablePrimitive,
        val p141: NullablePrimitive,
        val p142: NullablePrimitive,
        val p143: NullablePrimitive,
        val p144: NullablePrimitive,
        val p145: NullablePrimitive,
        val p146: NullablePrimitive,
        val p147: NullablePrimitive,
        val p148: NullablePrimitive,
        val p149: NullablePrimitive,
        val p150: NullablePrimitive,
        val p151: NullablePrimitive,
        val p152: NullablePrimitive,
        val p153: NullablePrimitive,
        val p154: NullablePrimitive,
        val p155: NullablePrimitive,
        val p156: NullablePrimitive,
        val p157: NullablePrimitive,
        val p158: NullablePrimitive,
        val p159: NullablePrimitive,
        val p160: NullablePrimitive,
        val p161: NullablePrimitive,
        val p162: NullablePrimitive,
        val p163: NullablePrimitive,
        val p164: NullablePrimitive,
        val p165: NullablePrimitive,
        val p166: NullablePrimitive,
        val p167: NullablePrimitive,
        val p168: NullablePrimitive,
        val p169: NullablePrimitive,
        val p170: NullablePrimitive,
        val p171: NullablePrimitive,
        val p172: NullablePrimitive,
        val p173: NullablePrimitive,
        val p174: NullablePrimitive,
        val p175: NullablePrimitive,
        val p176: NullablePrimitive,
        val p177: NullablePrimitive,
        val p178: NullablePrimitive,
        val p179: NullablePrimitive,
        val p180: NullablePrimitive,
        val p181: NullablePrimitive,
        val p182: NullablePrimitive,
        val p183: NullablePrimitive,
        val p184: NullablePrimitive,
        val p185: NullablePrimitive,
        val p186: NullablePrimitive,
        val p187: NullablePrimitive,
        val p188: NullablePrimitive,
        val p189: NullablePrimitive,
        val p190: NullablePrimitive,
        val p191: NullablePrimitive,
        val p192: NullablePrimitive,
        val p193: NullablePrimitive,
        val p194: NullablePrimitive,
        val p195: NullablePrimitive,
        val p196: NullablePrimitive,
        val p197: NullablePrimitive,
        val p198: NullablePrimitive,
        val p199: NullablePrimitive,
        val p200: NullablePrimitive,
        val p201: NullablePrimitive,
        val p202: NullablePrimitive,
        val p203: NullablePrimitive,
        val p204: NullablePrimitive,
        val p205: NullablePrimitive,
        val p206: NullablePrimitive,
        val p207: NullablePrimitive,
        val p208: NullablePrimitive,
        val p209: NullablePrimitive,
        val p210: NullablePrimitive,
        val p211: NullablePrimitive,
        val p212: NullablePrimitive,
        val p213: NullablePrimitive,
        val p214: NullablePrimitive,
        val p215: NullablePrimitive,
        val p216: NullablePrimitive,
        val p217: NullablePrimitive,
        val p218: NullablePrimitive,
        val p219: NullablePrimitive,
        val p220: NullablePrimitive,
        val p221: NullablePrimitive,
        val p222: NullablePrimitive,
        val p223: NullablePrimitive,
        val p224: NullablePrimitive,
        val p225: NullablePrimitive,
        val p226: NullablePrimitive,
        val p227: NullablePrimitive,
        val p228: NullablePrimitive,
        val p229: NullablePrimitive,
        val p230: NullablePrimitive,
        val p231: NullablePrimitive,
        val p232: NullablePrimitive,
        val p233: NullablePrimitive,
        val p234: NullablePrimitive,
        val p235: NullablePrimitive,
        val p236: NullablePrimitive,
        val p237: NullablePrimitive,
        val p238: NullablePrimitive,
        val p239: NullablePrimitive,
        val p240: NullablePrimitive,
        val p241: NullablePrimitive,
        val p242: NullablePrimitive,
        val p243: NullablePrimitive,
        val p244: NullablePrimitive,
        val p245: NullablePrimitive,
        val p246: NullablePrimitive,
        val p247: NullablePrimitive,
        val p248: NullablePrimitive,
        val p249: NullablePrimitive,
        val p250: NullablePrimitive,
        val p251: NullablePrimitive,
        val p252: NullablePrimitive
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q000: NullablePrimitive,
                q001: NullablePrimitive,
                q002: NullablePrimitive,
                q003: NullablePrimitive,
                q004: NullablePrimitive,
                q005: NullablePrimitive,
                q006: NullablePrimitive,
                q007: NullablePrimitive,
                q008: NullablePrimitive,
                q009: NullablePrimitive,
                q010: NullablePrimitive,
                q011: NullablePrimitive,
                q012: NullablePrimitive,
                q013: NullablePrimitive,
                q014: NullablePrimitive,
                q015: NullablePrimitive,
                q016: NullablePrimitive,
                q017: NullablePrimitive,
                q018: NullablePrimitive,
                q019: NullablePrimitive,
                q020: NullablePrimitive,
                q021: NullablePrimitive,
                q022: NullablePrimitive,
                q023: NullablePrimitive,
                q024: NullablePrimitive,
                q025: NullablePrimitive,
                q026: NullablePrimitive,
                q027: NullablePrimitive,
                q028: NullablePrimitive,
                q029: NullablePrimitive,
                q030: NullablePrimitive,
                q031: NullablePrimitive,
                q032: NullablePrimitive,
                q033: NullablePrimitive,
                q034: NullablePrimitive,
                q035: NullablePrimitive,
                q036: NullablePrimitive,
                q037: NullablePrimitive,
                q038: NullablePrimitive,
                q039: NullablePrimitive,
                q040: NullablePrimitive,
                q041: NullablePrimitive,
                q042: NullablePrimitive,
                q043: NullablePrimitive,
                q044: NullablePrimitive,
                q045: NullablePrimitive,
                q046: NullablePrimitive,
                q047: NullablePrimitive,
                q048: NullablePrimitive,
                q049: NullablePrimitive,
                q050: NullablePrimitive,
                q051: NullablePrimitive,
                q052: NullablePrimitive,
                q053: NullablePrimitive,
                q054: NullablePrimitive,
                q055: NullablePrimitive,
                q056: NullablePrimitive,
                q057: NullablePrimitive,
                q058: NullablePrimitive,
                q059: NullablePrimitive,
                q060: NullablePrimitive,
                q061: NullablePrimitive,
                q062: NullablePrimitive,
                q063: NullablePrimitive,
                q064: NullablePrimitive,
                q065: NullablePrimitive,
                q066: NullablePrimitive,
                q067: NullablePrimitive,
                q068: NullablePrimitive,
                q069: NullablePrimitive,
                q070: NullablePrimitive,
                q071: NullablePrimitive,
                q072: NullablePrimitive,
                q073: NullablePrimitive,
                q074: NullablePrimitive,
                q075: NullablePrimitive,
                q076: NullablePrimitive,
                q077: NullablePrimitive,
                q078: NullablePrimitive,
                q079: NullablePrimitive,
                q080: NullablePrimitive,
                q081: NullablePrimitive,
                q082: NullablePrimitive,
                q083: NullablePrimitive,
                q084: NullablePrimitive,
                q085: NullablePrimitive,
                q086: NullablePrimitive,
                q087: NullablePrimitive,
                q088: NullablePrimitive,
                q089: NullablePrimitive,
                q090: NullablePrimitive,
                q091: NullablePrimitive,
                q092: NullablePrimitive,
                q093: NullablePrimitive,
                q094: NullablePrimitive,
                q095: NullablePrimitive,
                q096: NullablePrimitive,
                q097: NullablePrimitive,
                q098: NullablePrimitive,
                q099: NullablePrimitive,
                q100: NullablePrimitive,
                q101: NullablePrimitive,
                q102: NullablePrimitive,
                q103: NullablePrimitive,
                q104: NullablePrimitive,
                q105: NullablePrimitive,
                q106: NullablePrimitive,
                q107: NullablePrimitive,
                q108: NullablePrimitive,
                q109: NullablePrimitive,
                q110: NullablePrimitive,
                q111: NullablePrimitive,
                q112: NullablePrimitive,
                q113: NullablePrimitive,
                q114: NullablePrimitive,
                q115: NullablePrimitive,
                q116: NullablePrimitive,
                q117: NullablePrimitive,
                q118: NullablePrimitive,
                q119: NullablePrimitive,
                q120: NullablePrimitive,
                q121: NullablePrimitive,
                q122: NullablePrimitive,
                q123: NullablePrimitive,
                q124: NullablePrimitive,
                q125: NullablePrimitive,
                q126: NullablePrimitive,
                q127: NullablePrimitive,
                q128: NullablePrimitive,
                q129: NullablePrimitive,
                q130: NullablePrimitive,
                q131: NullablePrimitive,
                q132: NullablePrimitive,
                q133: NullablePrimitive,
                q134: NullablePrimitive,
                q135: NullablePrimitive,
                q136: NullablePrimitive,
                q137: NullablePrimitive,
                q138: NullablePrimitive,
                q139: NullablePrimitive,
                q140: NullablePrimitive,
                q141: NullablePrimitive,
                q142: NullablePrimitive,
                q143: NullablePrimitive,
                q144: NullablePrimitive,
                q145: NullablePrimitive,
                q146: NullablePrimitive,
                q147: NullablePrimitive,
                q148: NullablePrimitive,
                q149: NullablePrimitive,
                q150: NullablePrimitive,
                q151: NullablePrimitive,
                q152: NullablePrimitive,
                q153: NullablePrimitive,
                q154: NullablePrimitive,
                q155: NullablePrimitive,
                q156: NullablePrimitive,
                q157: NullablePrimitive,
                q158: NullablePrimitive,
                q159: NullablePrimitive,
                q160: NullablePrimitive,
                q161: NullablePrimitive,
                q162: NullablePrimitive,
                q163: NullablePrimitive,
                q164: NullablePrimitive,
                q165: NullablePrimitive,
                q166: NullablePrimitive,
                q167: NullablePrimitive,
                q168: NullablePrimitive,
                q169: NullablePrimitive,
                q170: NullablePrimitive,
                q171: NullablePrimitive,
                q172: NullablePrimitive,
                q173: NullablePrimitive,
                q174: NullablePrimitive,
                q175: NullablePrimitive,
                q176: NullablePrimitive,
                q177: NullablePrimitive,
                q178: NullablePrimitive,
                q179: NullablePrimitive,
                q180: NullablePrimitive,
                q181: NullablePrimitive,
                q182: NullablePrimitive,
                q183: NullablePrimitive,
                q184: NullablePrimitive,
                q185: NullablePrimitive,
                q186: NullablePrimitive,
                q187: NullablePrimitive,
                q188: NullablePrimitive,
                q189: NullablePrimitive,
                q190: NullablePrimitive,
                q191: NullablePrimitive,
                q192: NullablePrimitive,
                q193: NullablePrimitive,
                q194: NullablePrimitive,
                q195: NullablePrimitive,
                q196: NullablePrimitive,
                q197: NullablePrimitive,
                q198: NullablePrimitive,
                q199: NullablePrimitive,
                q200: NullablePrimitive,
                q201: NullablePrimitive,
                q202: NullablePrimitive,
                q203: NullablePrimitive,
                q204: NullablePrimitive,
                q205: NullablePrimitive,
                q206: NullablePrimitive,
                q207: NullablePrimitive,
                q208: NullablePrimitive,
                q209: NullablePrimitive,
                q210: NullablePrimitive,
                q211: NullablePrimitive,
                q212: NullablePrimitive,
                q213: NullablePrimitive,
                q214: NullablePrimitive,
                q215: NullablePrimitive,
                q216: NullablePrimitive,
                q217: NullablePrimitive,
                q218: NullablePrimitive,
                q219: NullablePrimitive,
                q220: NullablePrimitive,
                q221: NullablePrimitive,
                q222: NullablePrimitive,
                q223: NullablePrimitive,
                q224: NullablePrimitive,
                q225: NullablePrimitive,
                q226: NullablePrimitive,
                q227: NullablePrimitive,
                q228: NullablePrimitive,
                q229: NullablePrimitive,
                q230: NullablePrimitive,
                q231: NullablePrimitive,
                q232: NullablePrimitive,
                q233: NullablePrimitive,
                q234: NullablePrimitive,
                q235: NullablePrimitive,
                q236: NullablePrimitive,
                q237: NullablePrimitive,
                q238: NullablePrimitive,
                q239: NullablePrimitive,
                q240: NullablePrimitive,
                q241: NullablePrimitive,
                q242: NullablePrimitive,
                q243: NullablePrimitive,
                q244: NullablePrimitive,
                q245: NullablePrimitive,
                q246: NullablePrimitive,
                q247: NullablePrimitive,
                q248: NullablePrimitive,
                q249: NullablePrimitive,
                q250: NullablePrimitive,
                q251: NullablePrimitive,
                q252: NullablePrimitive
            ) = DstMax(
                q000,
                q001,
                q002,
                q003,
                q004,
                q005,
                q006,
                q007,
                q008,
                q009,
                q010,
                q011,
                q012,
                q013,
                q014,
                q015,
                q016,
                q017,
                q018,
                q019,
                q020,
                q021,
                q022,
                q023,
                q024,
                q025,
                q026,
                q027,
                q028,
                q029,
                q030,
                q031,
                q032,
                q033,
                q034,
                q035,
                q036,
                q037,
                q038,
                q039,
                q040,
                q041,
                q042,
                q043,
                q044,
                q045,
                q046,
                q047,
                q048,
                q049,
                q050,
                q051,
                q052,
                q053,
                q054,
                q055,
                q056,
                q057,
                q058,
                q059,
                q060,
                q061,
                q062,
                q063,
                q064,
                q065,
                q066,
                q067,
                q068,
                q069,
                q070,
                q071,
                q072,
                q073,
                q074,
                q075,
                q076,
                q077,
                q078,
                q079,
                q080,
                q081,
                q082,
                q083,
                q084,
                q085,
                q086,
                q087,
                q088,
                q089,
                q090,
                q091,
                q092,
                q093,
                q094,
                q095,
                q096,
                q097,
                q098,
                q099,
                q100,
                q101,
                q102,
                q103,
                q104,
                q105,
                q106,
                q107,
                q108,
                q109,
                q110,
                q111,
                q112,
                q113,
                q114,
                q115,
                q116,
                q117,
                q118,
                q119,
                q120,
                q121,
                q122,
                q123,
                q124,
                q125,
                q126,
                q127,
                q128,
                q129,
                q130,
                q131,
                q132,
                q133,
                q134,
                q135,
                q136,
                q137,
                q138,
                q139,
                q140,
                q141,
                q142,
                q143,
                q144,
                q145,
                q146,
                q147,
                q148,
                q149,
                q150,
                q151,
                q152,
                q153,
                q154,
                q155,
                q156,
                q157,
                q158,
                q159,
                q160,
                q161,
                q162,
                q163,
                q164,
                q165,
                q166,
                q167,
                q168,
                q169,
                q170,
                q171,
                q172,
                q173,
                q174,
                q175,
                q176,
                q177,
                q178,
                q179,
                q180,
                q181,
                q182,
                q183,
                q184,
                q185,
                q186,
                q187,
                q188,
                q189,
                q190,
                q191,
                q192,
                q193,
                q194,
                q195,
                q196,
                q197,
                q198,
                q199,
                q200,
                q201,
                q202,
                q203,
                q204,
                q205,
                q206,
                q207,
                q208,
                q209,
                q210,
                q211,
                q212,
                q213,
                q214,
                q215,
                q216,
                q217,
                q218,
                q219,
                q220,
                q221,
                q222,
                q223,
                q224,
                q225,
                q226,
                q227,
                q228,
                q229,
                q230,
                q231,
                q232,
                q233,
                q234,
                q235,
                q236,
                q237,
                q238,
                q239,
                q240,
                q241,
                q242,
                q243,
                q244,
                q245,
                q246,
                q247,
                q248,
                q249,
                q250,
                q251,
                q252
            )
        }
    }

    @Test
    fun testMax() {
        val expected = callPrimaryConstructor<DstMax> { NullablePrimitive(it.index) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        assertReflectEquals(expected, defaultMapper.readValue<DstMax>(src))
    }
}
